<!--
  - Copyright (c) 2019.  武汉中科图灵科技有限公司
  - Date :  2019/4/9
  - Author ：F12 Console=> atob("MzMxNDkxODAwQHFxLmNvbQ==")
  - Version ：1.7.0
  -->

<template>
  <div><div class="abstatic-height"></div>
  <div class="wrap">
   <div class="manage-rule-header">
     <el-button type="text" icon="el-icon-arrow-left" @click="backPre">规则列表</el-button>管理规则
   </div>
  <fireMainframe v-if="nShow" :noticeRuleId.sync="noticeRuleId" :channelId.sync="channelId"></fireMainframe>
  <deviceList v-if="Show" :noticeRuleId.sync="noticeRuleId" :channelId.sync="channelId"></deviceList>
  </div>
  </div>
</template>

<script>
    import fireMainframe from "@/components/noticRulelist/firemain";
    import deviceList from "@/components/noticRulelist/device";
    export default {
        name: "manageRules",
        components:{fireMainframe,deviceList},
        data(){
          return {
              channelId:'',
              noticeRuleId:'',
              nShow:false,
              Show:false,
           }
        },
      created(){
          this.channelId = this.$route.params.id;
          this.noticeRuleId = this.$route.query.noticeRuleId;
          this.initLoad();
      },
      methods:{
        backPre(){
            this.$router.back(-1);
            sessionStorage.setItem('backlist','true')
        },
        initLoad(){
          if (this.channelId==='11'){
            //消防主机列表
            this.nShow = true
          }else{
            //非消防主机列表
            this.Show = true
          }
        }
      }
    }
</script>

<style lang="scss">
  .manage-rule-header{
    color: rgba(255,255,255,.7);
    text-align: center;
    line-height: 36px;
    font-weight: bold;
    border-bottom: 1px solid rgba(80, 227, 194,.3);
    margin-top: 20px;
    position: relative;
    button{
      position: absolute;
      left: 20px;
    }
  }
</style>
